<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Array Buffer</title>
</head>
<body>
  <script>
    const buf = new ArrayBuffer(16);  // 在内存中分配 16 字节
    console.log(buf.byteLength);
  </script>

  <script>
    // 一旦创建就不能调整大小
    const buf1 = new ArrayBuffer(16);
    const buf2 = buf1.slice(4, 12);
    console.log(buf2.byteLength);
  </script>
</body>
</html>